package com.spark.client.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 星火大模型配置类
 * 支持从 yml 配置文件中读取配置信息
 */
@ConfigurationProperties(prefix = "spark")
public class SparkConfig {
    
    /**
     * API 密钥
     */
    private String apiKey;
    
    /**
     * 请求地址
     */
    private String baseUrl = "https://spark-api-open.xf-yun.com/v1/chat/completions";
    
    /**
     * 默认模型
     */
    private String model = "generalv3.5";
    
    /**
     * 默认最大 tokens
     */
    private Integer maxTokens = 4096;
    
    /**
     * 默认温度
     */
    private Double temperature = 0.5;
    
    /**
     * 默认连接超时时间（毫秒）
     */
    private Integer connectTimeout = 30000;
    
    /**
     * 默认读取超时时间（毫秒）
     */
    private Integer readTimeout = 60000;
    
    /**
     * 是否启用日志
     */
    private Boolean enableLogging = true;

    // Getters and Setters
    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public Integer getMaxTokens() {
        return maxTokens;
    }

    public void setMaxTokens(Integer maxTokens) {
        this.maxTokens = maxTokens;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Integer getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(Integer connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public Integer getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(Integer readTimeout) {
        this.readTimeout = readTimeout;
    }

    public Boolean getEnableLogging() {
        return enableLogging;
    }

    public void setEnableLogging(Boolean enableLogging) {
        this.enableLogging = enableLogging;
    }
}
